package kamikaze.support;

import javax.persistence.EntityManager;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * request scoped.
 * 
 * @author Dapeng
 * 
 */
public interface ServiceContext {

	HttpServletRequest getRequest();

	HttpServletResponse getResponse();

	/**
	 * 
	 * @return the EntityManage associated with this request. an transaction is
	 *         automatically started also.
	 * 
	 *         you do NOT need to manually manage the transaction. it will be
	 *         automatically committed or rolled back at the end of the request
	 */
	EntityManager getEntityManager();

	UserSession getUserSession();
}
